// src/utils/date.js
import dayjs from 'dayjs'
import relativeTime from 'dayjs/plugin/relativeTime'
import 'dayjs/locale/zh-cn'

dayjs.extend(relativeTime)
dayjs.locale('zh-cn')

export const formatTime = (time) => {
  return dayjs(time).fromNow()
}

export const fullDateTime = (time) => {
  return dayjs(time).format('YYYY-MM-DD HH:mm:ss')
}